package alipay.openplatform.edu.campus.jiuye.common.utils;

import java.util.Locale;

/**
 * Created by zong on 16/8/22.
 */
public class StringUtils {

    public static String upperCase(String str) {
        return str == null?null:str.toUpperCase();
    }

    public static String upperCase(String str, Locale locale) {
        return str == null?null:str.toUpperCase(locale);
    }

    public static String lowerCase(String str) {
        return str == null?null:str.toLowerCase();
    }

    public static String lowerCase(String str, Locale locale) {
        return str == null?null:str.toLowerCase(locale);
    }

    public static boolean equals(String str1, String str2) {
        return str1 == null?str2 == null:str1.equals(str2);
    }

    public static String toSafe(String str)
    {
        str = str.replace("'","&apos;").replace("&","&amp;").replace("\"","&quot;").replace(">","&gt;").replace("<","&lt;");
        return str;
    }

}
